package com.mgang.web.controller;

import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.plugin.ehcache.CacheInterceptor;
import com.jfinal.plugin.spring.Inject.BY_NAME;
import com.jfinal.plugin.spring.IocInterceptor;
import com.mgang.model.TestUser;
/**
 * 
 * @author meigang 
 * 测试数据库的CRUD
 *
 */
@Before({CacheInterceptor.class,IocInterceptor.class})
public class MysqlController extends Controller{
	@BY_NAME
	private TestUser tu;
	
	public void add(){
		tu.testAdd();
		renderJsp("/junit.jsp");
	}
	
	public void delete(){
		tu.testDelete();
		renderJsp("/junit.jsp");
	}
	public void update(){
		tu.testUpdate();
		renderJsp("/junit.jsp");
	}
	public void find(){
		tu.testFind();
		renderJsp("/junit.jsp");
	}
	
	public void findPage(){
		tu.testFindPage();
		renderJsp("/junit.jsp");
	}
	public void tx(){
		tu.testAddAndUpdate();
		renderJsp("/junit.jsp");
	}
}
